package cn.gjculture.shopping.api.dao;

import cn.gjculture.shopping.api.entity.Notice;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface NoticeDao {
    @Insert("insert into notice(noticeId,noticeName,noticeContent,insertTime,updateTime,status,publish) " +
            "values(#{noticeId},#{noticeName},#{noticeContent},#{insertTime},#{updateTime},#{status},#{publish})")
    int save(Notice notice);

    @Select("select * from notice")
    List<Notice> query();

    @Select("select * from notice where publish=0 or publish=2")
    List<Notice> queryPublish();

    @Select("select * from notice where publish=2")
    List<Notice> queryRecommend();

}
